package com.jeesite.common.utils.excel.fieldtype;

import com.jeesite.common.utils.SpringUtils;
import com.jeesite.modules.fl.entity.Enterprise;
import com.jeesite.modules.fl.service.EnterpriseService;

public class EnterpriseType {
	
	private static EnterpriseService enterpriseService = SpringUtils.getBean(EnterpriseService.class);

	public static Object getValue(String val)
    {
        return enterpriseService.getByName(val);
    }
	
	public static String setValue(Object val)
    {
        if(val instanceof Enterprise)
        {
        	  Enterprise enterprise = (Enterprise)val;
            return enterprise.getName();
        } else
        {
            return "";
        }
    }
}
